import React, { Component } from 'react';
import axios from 'axios';
import {connect} from 'react-redux'
import {NavBar} from 'antd-mobile'
class Registers extends Component {
    constructor(props){
        super(props);
        this.state={
            phone:"",
            pass:""
        }
        }
    handleLogin(){
        console.log(this.state);
        axios.post("/api/registers",this.state).then((res)=>{
            console.log(res.data);
        })
    }
    render() {
        return (
            <div className="registers">
                <NavBar onBack={()=>{this.props.history.goBack()}}></NavBar>
                <div className="line">
                    <input type="text" value={this.state.phone} onChange={(e)=>{this.setState({phone:e.target.value})}} placeholder="输入账号" />
                </div>
                <div className="line">
                    <input type="text" value={this.state.pass} onChange={(e)=>{this.setState({pass:e.target.value})}} placeholder="输入密码" />
                </div>
                <div className="line">
                    <input onClick={()=>{this.handleLogin()}} type="button"  value="登录" />
                </div>
            </div>
        );
    }
}
export default connect((state)=>{
    return {
        
    }
},(dispatch)=>{
    return{

    }
}) (Registers);